package com.ming.interview;

import java.util.Scanner;

/**
 * @Description 输入某年某月某日，判断这一天是这一年的第几天？
 * @Author ye.ming
 * @Date Created in 2019/8/26
 */
public class Main13 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.println("请输入年月日（用空格隔开）：");
        int year = sc.nextInt();
        int month = sc.nextInt();
        int day = sc.nextInt();
        int sum = day;
        int[] arr = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

        for (int i = 0; i < month  - 1; i++) {
            sum += arr[i];
        }

        if ((year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) && month > 2) {
            sum++;
        }

        System.out.println(year + "年" + month + "月" + day + "日，是这年的第" + sum + "天");

    }


    private static void m1(int m, int n) {

    }


}
